package com.rockcent.mall.lib.helper;

import com.rockcent.common.utils.RDigestUtils;
import com.rockcent.mall.lib.repository.CustomerRepository;
import com.rockcent.mall.lib.repository.MallRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.Random;

/**
 * Created by zhangjh on 2016/10/9.
 */
public class BaseChannelHelper {
    private static final Logger log = LoggerFactory.getLogger(BaseChannelHelper.class);

    @Autowired
    private MallRepository mallRepository;
    @Autowired
    private CustomerRepository customerRepository;


    /**
     * 生成渠道分销码
     * @return
     */
    public String genSalesCode() {
        return RDigestUtils.md5Hex(new Date().getTime() + new Random().nextInt() + "");
    }


}
